home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Health'nstein's Body Fun
/
bodyfun.iso
/
mac
/
MAC MOVIE FOLDER
/
GYM.DIR
/
00499_Script_499
< prev
Wrap
Text File
|
1994-10-12
|
6KB
|
207 lines
on startMovie
StdStartMovie
global GymPoints
set GymPoints = 0
end startMovie
on DoFinal
DoFinalHelpCard
end
on BeforeHelp
sound stop 1
sound stop 2
end
on AfterHelp
end
on DragSlider
put the clickOn into clickSprite
put GetSpriteName(clickSprite) into sliderName
put sliderName & " Range" into rangeName
put GetSpriteNamed(rangeName) into rangeSprite
put the rect of sprite rangeSprite into theRect
set rangeWidth = getAt(theRect, 3) - getAt(theRect, 1)
set rangeHeight = getAt(theRect, 4) - getAt(theRect, 2)
set clickH = getAt(the clickLoc, 1)
set clickV = getAt(the clickLoc, 2)
if rangeWidth > rangeHeight then
DragSliderH clickSprite, clickH, getAt(theRect, 1), getAt(theRect, 3)
else
DragSliderV clickSprite, clickV, getAt(theRect, 4), getAt(theRect, 2)
end if
-- global WarningMoviePlayed, WorkoutHours
-- if WarningMoviePlayed = FALSE and WorkoutHours > GetWarnHours() then
-- sound stop 1
-- sound stop 2
-- set the movieTime of sprite 9 to 0
-- set the visible of sprite 9 to TRUE
-- set the movieRate of sprite 9 to 1
-- set WarningMoviePlayed = TRUE
-- end if
end
on DragSliderH clickSprite, clickH, theL, theR
put the locH of sprite clickSprite into startH
repeat while the stilldown
set nextH = startH + the mouseH - clickH
set nextH = min(theR, nextH)
set nextH = max(theL, nextH)
set the locH of sprite clickSprite to nextH
updateStage
end repeat
global WorkoutHours
set thePercentage = (the locH of sprite clickSprite - theL)/float(theR - theL)
set WorkoutHours = thePercentage * GetMaxMachineHours()
put thePercentage && WorkoutHours && GetMaxMachineHours()
if WorkoutHours <= 5 then
set WorkoutHours = 0.0
set the locH of sprite clickSprite to theL
end if
end
on DragSliderV clickSprite, clickV, theB, theT
put the locV of sprite clickSprite into startV
repeat while the stilldown
set nextV = startV + the mouseV - clickV
set nextV = min(theB, nextV)
set nextV = max(theT, nextV)
set the locV of sprite clickSprite to nextV
updateStage
end repeat
global WorkoutHours
set thePercentage = (theB - the locV of sprite clickSprite)/float(theB - theT)
set WorkoutHours = thePercentage * GetMaxMachineHours()
--put thePercentage && WorkoutHours && GetMaxMachineHours()
if WorkoutHours <= 5 then
set WorkoutHours = 0.0
set the locV of sprite clickSprite to theB
end if
end
on HideChallengerPictures
cursor 4
set the visible of sprite 14 to FALSE
set the visible of sprite 15 to FALSE
set the visible of sprite 16 to FALSE
updateStage
end
on SetAwardMovie
global GymPoints, gMovieMedia
global WorkoutHours
global gQuad
SaveWorkoutHistory("GYM " & gQuad & ", " & WorkoutHours)
if WorkoutHours >= (GetFailHours()) then
set theFile = gMovieMedia & "AD_FAIL.MOV"
set GymPoints = 0
SaveExerciseHistory(4)
else
if WorkoutHours < GetAwardHours(3) then
set theFile = gMovieMedia & "AD_AWRD3.MOV"
set GymPoints = 1
SaveExerciseHistory(1)
else if WorkoutHours < GetAwardHours(2) then
set theFile = gMovieMedia & "AD_AWRD2.MOV"
set GymPoints = 2
SaveExerciseHistory(2)
else
set theFile = gMovieMedia & "AD_AWRD1.MOV"
set GymPoints = 3
SaveExerciseHistory(3)
end if
end if
set the fileName of cast "Award Movie" to theFile
go to frame(the frame + 1)
set the movieTime of sprite 7 to 0
set the movieRate of sprite 7 to 1
end
on StartStepSlider sliderSprite
global startH, stopH, deltaH, startV, stopV, deltaV, startTicks, isH
put the locH of sprite sliderSprite into startH
put the locV of sprite sliderSprite into startV
put the ticks into startTicks
put GetSpriteName(sliderSprite) into sliderName
put sliderName & " Range" into rangeName
put GetSpriteNamed(rangeName) into rangeSprite
put the rect of sprite rangeSprite into theRect
set rangeWidth = getAt(theRect, 3) - getAt(theRect, 1)
set rangeHeight = getAt(theRect, 4) - getAt(theRect, 2)
if rangeWidth > rangeHeight then
set isH = TRUE
set stopH = getAt(theRect, 1)
set deltaH = float(rangeWidth)/960
else
set isH = FALSE
set stopV = getAt(theRect, 4)
set deltaV = float(rangeHeight)/960
end if
end
on StartWorkoutMovie
global WorkoutHours
put the duration of cast (the castNum of sprite 7) into theDur
if WorkoutHours >= (GetFailHours()) then
-- make them crash
set stopIt = integer(theDur)
set startIt = integer(theDur - (WorkoutHours / GetMaxMachineHours() * 16.0 * 60.0))
--put startIt && stopIt
else
-- no crash
set startIt = 0
set stopIt = integer(WorkoutHours / GetMaxMachineHours() * 16.0 * 60.0)
--put startIt && stopIt
end if
StartStepSlider 5
set the startTime of sprite 7 to startIt
set the movieTime of sprite 7 to startIt
--set the visible of sprite 7 to TRUE
set the movieRate of sprite 7 to 1
set the stopTime of sprite 7 to stopIt
end
on StepSlider sliderSprite
global startH, stopH, deltaH, startV, stopV, deltaV, startTicks, isH
set elapsedTicks = the ticks - startTicks
if isH = TRUE then
set nextH = startH - (elapsedTicks * deltaH)
set nextH = max(stopH, nextH)
set the locH of sprite sliderSprite to nextH
if nextH = stopH then
--put elapsedTicks
set the movieRate of sprite 7 to 0
else
go to frame the frame
end if
else
set nextV = startV + (elapsedTicks * deltaV)
set nextV = min(stopV, nextV)
set the locV of sprite sliderSprite to nextV
if nextV = stopV then
--put elapsedTicks
set the movieRate of sprite 7 to 0
else
go to frame the frame
end if
end if
end